from pygal.style import LightColorizedStyle as LCS, LightenStyle as LS
import pygal

my_style = LS("#ff33cc", base_style=LCS)
my_config = pygal.Config()
my_config.style = my_style
my_config.title = "工具提示"
my_config.x_label_rotation = 45
my_config.show_legend = -False
my_config.title_font_size = 24
my_config.label_font_size = 14
# 主标签的字体
my_config.major_label_font_size = 18
# 将较长的项目名缩短为15个字符
my_config.truncate_label = 15
# y坐标中的虚线,这个虚线是表示1个区间的分界线
my_config.show_y_guides = False
# 设置了自定义宽度，让图表更充分地利用浏览器中的可用空间
my_config.width = 1000

chart = pygal.Bar(my_config)
chart.x_labels = ['httpie', 'django', 'flask']

plot_dicts = [{'value': 16101, 'label': 'Description of httpie.'},
                   {'value': 15028, 'label': 'Description of django.'},
                   {'value': 14798, 'label': 'Description of flask.'}]

chart.add("", plot_dicts)
chart.render_to_file("工具栏提示.svg")
